<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - src/caffe/layers/im2col_layer.cpp</title>
  <link rel="stylesheet" type="text/css" href="../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../index.html">top level</a> - <a href="index.html">src/caffe/layers</a> - im2col_layer.cpp<span style="font-size: 80%;"> (source / <a href="im2col_layer.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntry">118</td>
            <td class="headerCovTableEntryLo">1.7 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntry">16</td>
            <td class="headerCovTableEntryLo">12.5 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #include &lt;vector&gt;</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : #include &quot;caffe/layers/im2col_layer.hpp&quot;
<span class="lineNum">       4 </span>            : #include &quot;caffe/util/im2col.hpp&quot;
<span class="lineNum">       5 </span>            : 
<span class="lineNum">       6 </span>            : namespace caffe {
<span class="lineNum">       7 </span>            : 
<span class="lineNum">       8 </span>            : template &lt;typename Dtype&gt;
<span class="lineNum">       9 </span><span class="lineNoCov">          0 : void Im2colLayer&lt;Dtype&gt;::LayerSetUp(const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; bottom,</span>
<span class="lineNum">      10 </span>            :       const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; top) {
<span class="lineNum">      11 </span><span class="lineNoCov">          0 :   ConvolutionParameter conv_param = this-&gt;layer_param_.convolution_param();</span>
<span class="lineNum">      12 </span><span class="lineNoCov">          0 :   force_nd_im2col_ = conv_param.force_nd_im2col();</span>
<span class="lineNum">      13 </span><span class="lineNoCov">          0 :   const int input_num_dims = bottom[0]-&gt;shape().size();</span>
<span class="lineNum">      14 </span><span class="lineNoCov">          0 :   channel_axis_ = bottom[0]-&gt;CanonicalAxisIndex(conv_param.axis());</span>
<span class="lineNum">      15 </span><span class="lineNoCov">          0 :   const int first_spatial_dim = channel_axis_ + 1;</span>
<span class="lineNum">      16 </span><span class="lineNoCov">          0 :   num_spatial_axes_ = input_num_dims - first_spatial_dim;</span>
<span class="lineNum">      17 </span><span class="lineNoCov">          0 :   CHECK_GE(num_spatial_axes_, 1);</span>
<span class="lineNum">      18 </span><span class="lineNoCov">          0 :   vector&lt;int&gt; dim_blob_shape(1, num_spatial_axes_);</span>
<span class="lineNum">      19 </span>            :   // Setup filter kernel dimensions (kernel_shape_).
<span class="lineNum">      20 </span><span class="lineNoCov">          0 :   kernel_shape_.Reshape(dim_blob_shape);</span>
<span class="lineNum">      21 </span><span class="lineNoCov">          0 :   int* kernel_shape_data = kernel_shape_.mutable_cpu_data();</span>
<span class="lineNum">      22 </span><span class="lineNoCov">          0 :   if (conv_param.has_kernel_h() || conv_param.has_kernel_w()) {</span>
<span class="lineNum">      23 </span><span class="lineNoCov">          0 :     CHECK_EQ(num_spatial_axes_, 2)</span>
<span class="lineNum">      24 </span>            :         &lt;&lt; &quot;kernel_h &amp; kernel_w can only be used for 2D convolution.&quot;;
<span class="lineNum">      25 </span><span class="lineNoCov">          0 :     CHECK_EQ(0, conv_param.kernel_size_size())</span>
<span class="lineNum">      26 </span>            :         &lt;&lt; &quot;Either kernel_size or kernel_h/w should be specified; not both.&quot;;
<span class="lineNum">      27 </span><span class="lineNoCov">          0 :     kernel_shape_data[0] = conv_param.kernel_h();</span>
<span class="lineNum">      28 </span><span class="lineNoCov">          0 :     kernel_shape_data[1] = conv_param.kernel_w();</span>
<span class="lineNum">      29 </span>            :   } else {
<span class="lineNum">      30 </span>            :     const int num_kernel_dims = conv_param.kernel_size_size();
<span class="lineNum">      31 </span><span class="lineNoCov">          0 :     CHECK(num_kernel_dims == 1 || num_kernel_dims == num_spatial_axes_)</span>
<span class="lineNum">      32 </span>            :         &lt;&lt; &quot;kernel_size must be specified once, or once per spatial dimension &quot;
<span class="lineNum">      33 </span><span class="lineNoCov">          0 :         &lt;&lt; &quot;(kernel_size specified &quot; &lt;&lt; num_kernel_dims &lt;&lt; &quot; times; &quot;</span>
<span class="lineNum">      34 </span><span class="lineNoCov">          0 :         &lt;&lt; num_spatial_axes_ &lt;&lt; &quot; spatial dims);&quot;;</span>
<span class="lineNum">      35 </span><span class="lineNoCov">          0 :       for (int i = 0; i &lt; num_spatial_axes_; ++i) {</span>
<span class="lineNum">      36 </span><span class="lineNoCov">          0 :         kernel_shape_data[i] =</span>
<span class="lineNum">      37 </span><span class="lineNoCov">          0 :             conv_param.kernel_size((num_kernel_dims == 1) ? 0 : i);</span>
<span class="lineNum">      38 </span>            :       }
<span class="lineNum">      39 </span>            :   }
<span class="lineNum">      40 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; num_spatial_axes_; ++i) {</span>
<span class="lineNum">      41 </span><span class="lineNoCov">          0 :     CHECK_GT(kernel_shape_data[i], 0) &lt;&lt; &quot;Filter dimensions must be nonzero.&quot;;</span>
<span class="lineNum">      42 </span>            :   }
<span class="lineNum">      43 </span>            :   // Setup stride dimensions (stride_).
<span class="lineNum">      44 </span><span class="lineNoCov">          0 :   stride_.Reshape(dim_blob_shape);</span>
<span class="lineNum">      45 </span><span class="lineNoCov">          0 :   int* stride_data = stride_.mutable_cpu_data();</span>
<span class="lineNum">      46 </span><span class="lineNoCov">          0 :   if (conv_param.has_stride_h() || conv_param.has_stride_w()) {</span>
<span class="lineNum">      47 </span><span class="lineNoCov">          0 :     CHECK_EQ(num_spatial_axes_, 2)</span>
<span class="lineNum">      48 </span>            :         &lt;&lt; &quot;stride_h &amp; stride_w can only be used for 2D convolution.&quot;;
<span class="lineNum">      49 </span><span class="lineNoCov">          0 :     CHECK_EQ(0, conv_param.stride_size())</span>
<span class="lineNum">      50 </span>            :         &lt;&lt; &quot;Either stride or stride_h/w should be specified; not both.&quot;;
<span class="lineNum">      51 </span><span class="lineNoCov">          0 :     stride_data[0] = conv_param.stride_h();</span>
<span class="lineNum">      52 </span><span class="lineNoCov">          0 :     stride_data[1] = conv_param.stride_w();</span>
<span class="lineNum">      53 </span>            :   } else {
<span class="lineNum">      54 </span>            :     const int num_stride_dims = conv_param.stride_size();
<span class="lineNum">      55 </span><span class="lineNoCov">          0 :     CHECK(num_stride_dims == 0 || num_stride_dims == 1 ||</span>
<span class="lineNum">      56 </span>            :           num_stride_dims == num_spatial_axes_)
<span class="lineNum">      57 </span>            :         &lt;&lt; &quot;stride must be specified once, or once per spatial dimension &quot;
<span class="lineNum">      58 </span><span class="lineNoCov">          0 :         &lt;&lt; &quot;(stride specified &quot; &lt;&lt; num_stride_dims &lt;&lt; &quot; times; &quot;</span>
<span class="lineNum">      59 </span><span class="lineNoCov">          0 :         &lt;&lt; num_spatial_axes_ &lt;&lt; &quot; spatial dims);&quot;;</span>
<span class="lineNum">      60 </span>            :     const int kDefaultStride = 1;
<span class="lineNum">      61 </span><span class="lineNoCov">          0 :     for (int i = 0; i &lt; num_spatial_axes_; ++i) {</span>
<span class="lineNum">      62 </span><span class="lineNoCov">          0 :       stride_data[i] = (num_stride_dims == 0) ? kDefaultStride :</span>
<span class="lineNum">      63 </span><span class="lineNoCov">          0 :           conv_param.stride((num_stride_dims == 1) ? 0 : i);</span>
<span class="lineNum">      64 </span><span class="lineNoCov">          0 :       CHECK_GT(stride_data[i], 0) &lt;&lt; &quot;Stride dimensions must be nonzero.&quot;;</span>
<span class="lineNum">      65 </span>            :     }
<span class="lineNum">      66 </span>            :   }
<span class="lineNum">      67 </span>            :   // Setup pad dimensions (pad_).
<span class="lineNum">      68 </span><span class="lineNoCov">          0 :   pad_.Reshape(dim_blob_shape);</span>
<span class="lineNum">      69 </span><span class="lineNoCov">          0 :   int* pad_data = pad_.mutable_cpu_data();</span>
<span class="lineNum">      70 </span><span class="lineNoCov">          0 :   if (conv_param.has_pad_h() || conv_param.has_pad_w()) {</span>
<span class="lineNum">      71 </span><span class="lineNoCov">          0 :     CHECK_EQ(num_spatial_axes_, 2)</span>
<span class="lineNum">      72 </span>            :         &lt;&lt; &quot;pad_h &amp; pad_w can only be used for 2D convolution.&quot;;
<span class="lineNum">      73 </span><span class="lineNoCov">          0 :     CHECK_EQ(0, conv_param.pad_size())</span>
<span class="lineNum">      74 </span>            :         &lt;&lt; &quot;Either pad or pad_h/w should be specified; not both.&quot;;
<span class="lineNum">      75 </span><span class="lineNoCov">          0 :     pad_data[0] = conv_param.pad_h();</span>
<span class="lineNum">      76 </span><span class="lineNoCov">          0 :     pad_data[1] = conv_param.pad_w();</span>
<span class="lineNum">      77 </span>            :   } else {
<span class="lineNum">      78 </span>            :     const int num_pad_dims = conv_param.pad_size();
<span class="lineNum">      79 </span><span class="lineNoCov">          0 :     CHECK(num_pad_dims == 0 || num_pad_dims == 1 ||</span>
<span class="lineNum">      80 </span>            :           num_pad_dims == num_spatial_axes_)
<span class="lineNum">      81 </span>            :         &lt;&lt; &quot;pad must be specified once, or once per spatial dimension &quot;
<span class="lineNum">      82 </span><span class="lineNoCov">          0 :         &lt;&lt; &quot;(pad specified &quot; &lt;&lt; num_pad_dims &lt;&lt; &quot; times; &quot;</span>
<span class="lineNum">      83 </span><span class="lineNoCov">          0 :         &lt;&lt; num_spatial_axes_ &lt;&lt; &quot; spatial dims);&quot;;</span>
<span class="lineNum">      84 </span>            :     const int kDefaultPad = 0;
<span class="lineNum">      85 </span><span class="lineNoCov">          0 :     for (int i = 0; i &lt; num_spatial_axes_; ++i) {</span>
<span class="lineNum">      86 </span><span class="lineNoCov">          0 :       pad_data[i] = (num_pad_dims == 0) ? kDefaultPad :</span>
<span class="lineNum">      87 </span><span class="lineNoCov">          0 :           conv_param.pad((num_pad_dims == 1) ? 0 : i);</span>
<span class="lineNum">      88 </span>            :     }
<span class="lineNum">      89 </span>            :   }
<span class="lineNum">      90 </span>            :   // Setup dilation dimensions (dilation_).
<span class="lineNum">      91 </span><span class="lineNoCov">          0 :   dilation_.Reshape(dim_blob_shape);</span>
<span class="lineNum">      92 </span><span class="lineNoCov">          0 :   int* dilation_data = dilation_.mutable_cpu_data();</span>
<span class="lineNum">      93 </span>            :   const int num_dilation_dims = conv_param.dilation_size();
<span class="lineNum">      94 </span><span class="lineNoCov">          0 :   CHECK(num_dilation_dims == 0 || num_dilation_dims == 1 ||</span>
<span class="lineNum">      95 </span>            :         num_dilation_dims == num_spatial_axes_)
<span class="lineNum">      96 </span>            :       &lt;&lt; &quot;dilation must be specified once, or once per spatial dimension &quot;
<span class="lineNum">      97 </span><span class="lineNoCov">          0 :       &lt;&lt; &quot;(dilation specified &quot; &lt;&lt; num_dilation_dims &lt;&lt; &quot; times; &quot;</span>
<span class="lineNum">      98 </span><span class="lineNoCov">          0 :       &lt;&lt; num_spatial_axes_ &lt;&lt; &quot; spatial dims).&quot;;</span>
<span class="lineNum">      99 </span>            :   const int kDefaultDilation = 1;
<span class="lineNum">     100 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; num_spatial_axes_; ++i) {</span>
<span class="lineNum">     101 </span><span class="lineNoCov">          0 :     dilation_data[i] = (num_dilation_dims == 0) ? kDefaultDilation :</span>
<span class="lineNum">     102 </span><span class="lineNoCov">          0 :                        conv_param.dilation((num_dilation_dims == 1) ? 0 : i);</span>
<span class="lineNum">     103 </span>            :   }
<span class="lineNum">     104 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     105 </span>            : 
<span class="lineNum">     106 </span>            : template &lt;typename Dtype&gt;
<span class="lineNum">     107 </span><span class="lineNoCov">          0 : void Im2colLayer&lt;Dtype&gt;::Reshape(const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; bottom,</span>
<span class="lineNum">     108 </span>            :       const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; top) {
<span class="lineNum">     109 </span><span class="lineNoCov">          0 :   vector&lt;int&gt; top_shape = bottom[0]-&gt;shape();</span>
<span class="lineNum">     110 </span><span class="lineNoCov">          0 :   const int* kernel_shape_data = kernel_shape_.cpu_data();</span>
<span class="lineNum">     111 </span><span class="lineNoCov">          0 :   const int* stride_data = stride_.cpu_data();</span>
<span class="lineNum">     112 </span><span class="lineNoCov">          0 :   const int* pad_data = pad_.cpu_data();</span>
<span class="lineNum">     113 </span><span class="lineNoCov">          0 :   const int* dilation_data = dilation_.cpu_data();</span>
<span class="lineNum">     114 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; num_spatial_axes_; ++i) {</span>
<span class="lineNum">     115 </span><span class="lineNoCov">          0 :     top_shape[channel_axis_] *= kernel_shape_data[i];</span>
<span class="lineNum">     116 </span><span class="lineNoCov">          0 :     const int input_dim = bottom[0]-&gt;shape(channel_axis_ + i + 1);</span>
<span class="lineNum">     117 </span><span class="lineNoCov">          0 :     const int kernel_extent = dilation_data[i] * (kernel_shape_data[i] - 1) + 1;</span>
<span class="lineNum">     118 </span><span class="lineNoCov">          0 :     const int output_dim = (input_dim + 2 * pad_data[i] - kernel_extent)</span>
<span class="lineNum">     119 </span><span class="lineNoCov">          0 :         / stride_data[i] + 1;</span>
<span class="lineNum">     120 </span><span class="lineNoCov">          0 :     top_shape[channel_axis_ + i + 1] = output_dim;</span>
<span class="lineNum">     121 </span>            :   }
<span class="lineNum">     122 </span><span class="lineNoCov">          0 :   top[0]-&gt;Reshape(top_shape);</span>
<span class="lineNum">     123 </span><span class="lineNoCov">          0 :   num_ = bottom[0]-&gt;count(0, channel_axis_);</span>
<span class="lineNum">     124 </span><span class="lineNoCov">          0 :   bottom_dim_ = bottom[0]-&gt;count(channel_axis_);</span>
<span class="lineNum">     125 </span><span class="lineNoCov">          0 :   top_dim_ = top[0]-&gt;count(channel_axis_);</span>
<span class="lineNum">     126 </span>            : 
<span class="lineNum">     127 </span><span class="lineNoCov">          0 :   channels_ = bottom[0]-&gt;shape(channel_axis_);</span>
<span class="lineNum">     128 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     129 </span>            : 
<span class="lineNum">     130 </span>            : template &lt;typename Dtype&gt;
<span class="lineNum">     131 </span><span class="lineNoCov">          0 : void Im2colLayer&lt;Dtype&gt;::Forward_cpu(const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; bottom,</span>
<span class="lineNum">     132 </span>            :       const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; top) {
<span class="lineNum">     133 </span><span class="lineNoCov">          0 :   const Dtype* bottom_data = bottom[0]-&gt;cpu_data();</span>
<span class="lineNum">     134 </span><span class="lineNoCov">          0 :   Dtype* top_data = top[0]-&gt;mutable_cpu_data();</span>
<span class="lineNum">     135 </span><span class="lineNoCov">          0 :   for (int n = 0; n &lt; num_; ++n) {</span>
<span class="lineNum">     136 </span>            :     DCHECK_EQ(bottom[0]-&gt;shape().size() - channel_axis_, num_spatial_axes_ + 1);
<span class="lineNum">     137 </span>            :     DCHECK_EQ(top[0]-&gt;shape().size() - channel_axis_, num_spatial_axes_ + 1);
<span class="lineNum">     138 </span>            :     DCHECK_EQ(kernel_shape_.count(), num_spatial_axes_);
<span class="lineNum">     139 </span>            :     DCHECK_EQ(pad_.count(), num_spatial_axes_);
<span class="lineNum">     140 </span>            :     DCHECK_EQ(stride_.count(), num_spatial_axes_);
<span class="lineNum">     141 </span>            :     DCHECK_EQ(dilation_.count(), num_spatial_axes_);
<span class="lineNum">     142 </span><span class="lineNoCov">          0 :     if (!force_nd_im2col_ &amp;&amp; num_spatial_axes_ == 2) {</span>
<span class="lineNum">     143 </span><span class="lineNoCov">          0 :       im2col_cpu(bottom_data + n * bottom_dim_, channels_,</span>
<span class="lineNum">     144 </span><span class="lineNoCov">          0 :           bottom[0]-&gt;shape(channel_axis_ + 1),</span>
<span class="lineNum">     145 </span><span class="lineNoCov">          0 :           bottom[0]-&gt;shape(channel_axis_ + 2),</span>
<span class="lineNum">     146 </span><span class="lineNoCov">          0 :           kernel_shape_.cpu_data()[0], kernel_shape_.cpu_data()[1],</span>
<span class="lineNum">     147 </span><span class="lineNoCov">          0 :           pad_.cpu_data()[0], pad_.cpu_data()[1],</span>
<span class="lineNum">     148 </span><span class="lineNoCov">          0 :           stride_.cpu_data()[0], stride_.cpu_data()[1],</span>
<span class="lineNum">     149 </span><span class="lineNoCov">          0 :           dilation_.cpu_data()[0], dilation_.cpu_data()[1],</span>
<span class="lineNum">     150 </span><span class="lineNoCov">          0 :           top_data + n * top_dim_);</span>
<span class="lineNum">     151 </span>            :     } else {
<span class="lineNum">     152 </span><span class="lineNoCov">          0 :       im2col_nd_cpu(bottom_data + n * bottom_dim_, num_spatial_axes_,</span>
<span class="lineNum">     153 </span><span class="lineNoCov">          0 :           bottom[0]-&gt;shape().data() + channel_axis_,</span>
<span class="lineNum">     154 </span><span class="lineNoCov">          0 :           top[0]-&gt;shape().data() + channel_axis_,</span>
<span class="lineNum">     155 </span>            :           kernel_shape_.cpu_data(), pad_.cpu_data(), stride_.cpu_data(),
<span class="lineNum">     156 </span><span class="lineNoCov">          0 :           dilation_.cpu_data(), top_data + n * top_dim_);</span>
<span class="lineNum">     157 </span>            :     }
<span class="lineNum">     158 </span>            :   }
<span class="lineNum">     159 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     160 </span>            : 
<span class="lineNum">     161 </span>            : template &lt;typename Dtype&gt;
<span class="lineNum">     162 </span><span class="lineNoCov">          0 : void Im2colLayer&lt;Dtype&gt;::Backward_cpu(const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; top,</span>
<span class="lineNum">     163 </span>            :       const vector&lt;bool&gt;&amp; propagate_down, const vector&lt;Blob&lt;Dtype&gt;*&gt;&amp; bottom) {
<span class="lineNum">     164 </span><span class="lineNoCov">          0 :   const Dtype* top_diff = top[0]-&gt;cpu_diff();</span>
<span class="lineNum">     165 </span><span class="lineNoCov">          0 :   Dtype* bottom_diff = bottom[0]-&gt;mutable_cpu_diff();</span>
<span class="lineNum">     166 </span><span class="lineNoCov">          0 :   for (int n = 0; n &lt; num_; ++n) {</span>
<span class="lineNum">     167 </span><span class="lineNoCov">          0 :     if (!force_nd_im2col_ &amp;&amp; num_spatial_axes_ == 2) {</span>
<span class="lineNum">     168 </span><span class="lineNoCov">          0 :       col2im_cpu(top_diff + n * top_dim_, channels_,</span>
<span class="lineNum">     169 </span><span class="lineNoCov">          0 :           bottom[0]-&gt;shape(channel_axis_ + 1),</span>
<span class="lineNum">     170 </span><span class="lineNoCov">          0 :           bottom[0]-&gt;shape(channel_axis_ + 2),</span>
<span class="lineNum">     171 </span><span class="lineNoCov">          0 :           kernel_shape_.cpu_data()[0], kernel_shape_.cpu_data()[1],</span>
<span class="lineNum">     172 </span><span class="lineNoCov">          0 :           pad_.cpu_data()[0], pad_.cpu_data()[1],</span>
<span class="lineNum">     173 </span><span class="lineNoCov">          0 :           stride_.cpu_data()[0], stride_.cpu_data()[1],</span>
<span class="lineNum">     174 </span><span class="lineNoCov">          0 :           dilation_.cpu_data()[0], dilation_.cpu_data()[1],</span>
<span class="lineNum">     175 </span><span class="lineNoCov">          0 :           bottom_diff + n * bottom_dim_);</span>
<span class="lineNum">     176 </span>            :     } else {
<span class="lineNum">     177 </span><span class="lineNoCov">          0 :       col2im_nd_cpu(top_diff + n * top_dim_, num_spatial_axes_,</span>
<span class="lineNum">     178 </span><span class="lineNoCov">          0 :           bottom[0]-&gt;shape().data() + channel_axis_,</span>
<span class="lineNum">     179 </span><span class="lineNoCov">          0 :           top[0]-&gt;shape().data() + channel_axis_,</span>
<span class="lineNum">     180 </span>            :           kernel_shape_.cpu_data(), pad_.cpu_data(), stride_.cpu_data(),
<span class="lineNum">     181 </span><span class="lineNoCov">          0 :           dilation_.cpu_data(), bottom_diff + n * bottom_dim_);</span>
<span class="lineNum">     182 </span>            :     }
<span class="lineNum">     183 </span>            :   }
<span class="lineNum">     184 </span><span class="lineNoCov">          0 : }</span>
<a name="185"><span class="lineNum">     185 </span>            : </a>
<span class="lineNum">     186 </span>            : #ifdef CPU_ONLY
<span class="lineNum">     187 </span><span class="lineNoCov">          0 : STUB_GPU(Im2colLayer);</span>
<span class="lineNum">     188 </span>            : #endif
<a name="189"><span class="lineNum">     189 </span>            : </a>
<span class="lineNum">     190 </span>            : INSTANTIATE_CLASS(Im2colLayer);
<a name="191"><span class="lineNum">     191 </span><span class="lineCov">          3 : REGISTER_LAYER_CLASS(Im2col);</span></a>
<span class="lineNum">     192 </span>            : 
<span class="lineNum">     193 </span><span class="lineCov">          3 : }  // namespace caffe</span>
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
